package com.example.springboot_sp.mapper;

import com.example.springboot_sp.entity.Calendar;
import com.example.springboot_sp.entity.Word;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 郭守军
 * @since 2022-08-18
 */
public interface WordMapper extends BaseMapper<Word> {
    @Select("select * from sys_word where know != #{know} order by know desc")
    List<Word> getByknow(@Param("know") Integer know);

    @Update("update sys_word set know = know + 1 where word = #{word}")
    void updateKnow(@Param("word") String word);

    @Update("update sys_word set know = 0 where word = #{word}")
    void unknownDlete(@Param("word") String word);
}
